<#-- @ftlvariable name="layouts" type="java.util.List<com.fable.sp.core.domain.Layout>" -->
<table class="table table-bordered" style="margin-bottom: 0px;">
    <tr>
        <th>名称</th>
        <th>描述</th>
        <th>创建时间</th>
        <th>操作</th>
    </tr>
<#list layouts as layout>
    <tr>
        <td>${layout.name}</td>
        <td>${layout.info}</td>
        <td>${layout.createdDate.toDate()?string("yyyy-MM-dd HH:mm")}</td>
        <td class="text-right">
            <#if RequestParameters.select>
                <button role="button" class="btn btn-sm btn-default select-layout" data-id="${layout.id}">选取
                </button>
            <#else >
                <a role="button" class="btn btn-sm btn-primary"
                   href="<@spring.url relativeUrl='/sp/layoutControl'/>?layoutId=${layout.id}"
                   target="_blank">编辑</a>
                <button role="button" class="btn btn-sm btn-default copy-layout" data-id="${layout.id}">复制
                </button>
                <a role="button" class="btn btn-sm btn-default disable-layout"
                   href="<@spring.url relativeUrl='/sp/preview?layoutId=${layout.id}'/>" target="_blank">预览</a>
                <button role="button" class="btn btn-sm btn-default disable-layout" fake-delete-id="${layout.id}" fake-delete-class="${layout.getClass().getName()}">删除</button>
            </#if>
        </td>
    </tr>
<#else >
    <tr>
        <td class="text-center" colspan="4">
            暂未设置布局控制
        </td>
    </tr>
</#list>
</table>